package com.aurora.source.source.presenter;

import android.content.Context;

import com.aurora.source.authority.bean.PersonAuthAddBean;
import com.aurora.source.base.BaseActivity;
import com.aurora.source.base.BaseBean;
import com.aurora.source.base.BasePresenter;
import com.aurora.source.constant.AuroraConstants;
import com.aurora.source.source.view.IPortraitView;
import com.aurora.source.util.netutil.SubscriberObserver;

import java.io.File;
import java.util.Map;

public class PortraitPresenter extends BasePresenter<IPortraitView> {

    public PortraitPresenter(IPortraitView baseView) {
        super(baseView);
    }

    public void portrait(Context context, File file, Map<String, String> params) {
        requestMethod.protrait(params,file, new SubscriberObserver<BaseBean>(context,"正在加载中...") {
            @Override
            public void onSuccess(BaseBean personAuthAddBean) {
                baseView.onPortraitSuccess(personAuthAddBean.getMsg());
            }

            @Override
            public void onError(String msg) {
                baseView.onPortraitFail(msg);
            }

            @Override
            public void onFinish() {

            }
        });

    }
}
